/*
 * ICfg.c
 *
 *  Created on: 29.01.2013
 *      Author: ILYA
 */

/*
#include "ICfg.h"

enum CFG_STATE GetRootParam(char* path, GroupNodeParam* dest, int* count)
{
	if(xTaskGetCurrentTaskHandle() == current_Cfg_task_handle)
	{
		*count = analys_param(path);
		dest = &groupNodeParam;
		return SUCCESS;
	}
	else
	{
		Lock_cfg();
		*count = analys_param(path);
		dest = &groupNodeParam;
		//UnLock_cfg();
		return LOCKSUCCESS;
	}
}

enum CFG_STATE TryGetRootParam(int timeout, char* path, GroupNodeParam* dest, int* count)
{
	if(xTaskGetCurrentTaskHandle() == current_Cfg_task_handle)
	{
		*count = analys_param(path);
		dest = &groupNodeParam;
		return SUCCESS;
	}
	else
	{
		if(TryLock_cfg(timeout))
		{
			*count = analys_param(path);
			dest = &groupNodeParam;
			//UnLock_cfg();
			return LOCKSUCCESS;
		}
		else
			return BUSY;
	}
}

enum CFG_STATE GetConfigRoot(struct CfgRoot* cfg_root)
{
	if(xTaskGetCurrentTaskHandle() == current_Cfg_task_handle)
	{
		cfg_root = &ConfigRoot;
		return SUCCESS;
	}
	else if(current_Cfg_task_handle == 0)
	{
		Lock_cfg();
		cfg_root = &ConfigRoot;
		return LOCKSUCCESS;
	}
	else
	{
		return BUSY;
	}
}

enum CFG_STATE GetCurrentChannel(struct Node_channel* Curr_Channel)
{
	if(xTaskGetCurrentTaskHandle() == current_Cfg_task_handle)
	{
		Curr_Channel = &Current_Channel;
		return SUCCESS;
	}
	else if(current_Cfg_task_handle == 0)
	{
		Lock_cfg();
		Curr_Channel = &Current_Channel;
		return LOCKSUCCESS;
	}
	else
	{
		return BUSY;
	}
}

enum CFG_STATE GetOperationMode(struct OperationMode* op_mode)
{
	if(xTaskGetCurrentTaskHandle() == current_Cfg_task_handle)
	{
		op_mode = &operation_mode;
		return SUCCESS;
	}
	else if(current_Cfg_task_handle == 0)
	{
		Lock_cfg();
		op_mode = &operation_mode;
		return LOCKSUCCESS;
	}
	else
	{
		return BUSY;
	}
}
*/

